# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kio5
pkgver=5.116.0
pkgrel=0
pkgdesc="Resource and network access abstraction"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later AND (LGPL-2.1-only OR LGPL-3.0-only)"
depends_dev="
	karchive5-dev
	kbookmarks5-dev
	kcompletion5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kcrash5-dev
	kdbusaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kitemviews5-dev
	kjobwidgets5-dev
	knotifications5-dev
	kservice5-dev
	kwallet5-dev
	kwidgetsaddons5-dev
	kwindowsystem5-dev
	qt5-qtscript-dev
	solid5-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	kdoctools5-dev
	libxml2-dev
	libxslt-dev
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/kio.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kio-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-dbg $pkgname-doc $pkgname-lang $pkgname-kwallet"
options="!check" # Fails due to requiring physical devices not normally available and test 14 hangs
builddir="$srcdir/kio-$pkgver"

replaces="kio<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

kwallet() {
	pkgdesc="$pkgname KWallet integration"

	amove usr/lib/qt5/plugins/kf5/kiod/kpasswdserver.so
}

sha512sums="
a07661717846860db3a64bcead9c2b80192d8c5b8e66a25f0f83ced6b596c4e8af7eb94e68b17770f45b36b22ccbcecaef4f8590d790cf69fceb140ab9e47376  kio-5.116.0.tar.xz
"
